﻿@model LynxWebLog.Areas.Pages.ViewModels.PageEntry

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm("Create", "PageEntry", FormMethod.Post)) 
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset class="form-horizontal">
        <legend>Page Entry</legend>
        <div class="row">
            <div class="col-sm-2 col-md-2 col-lg-2">
                <div class="form-group">
                    @Html.LabelFor(model => model.pd.pageid, new { @class = "control-label", disabled = "disabled" })
                                <div class="controls">
                                    <input type="text" id="pd_postid" name="pd.postid" class="form-control input-sm" value="0" disabled="disabled" />
                                    @Html.ValidationMessageFor(model => model.pd.pageid, null, new { @class = "help-inline" })
                                                <input type="hidden" name="pd.pageid" id="hpd_pageidid" value="0" />
                                            </div>
                                        </div>
            </div>
            <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-6 col-md-5 col-lg-4">
                <div class="form-group">
                    @Html.LabelFor(model => model.pd.blogid, new { @class = "control-label" })
                                <div class="controls">
                                    <input type="text" id="pd_blogid" name="pd.blogid" class="form-control input-sm" value=@ViewBag.BlogId />
                                    @Html.ValidationMessageFor(model => model.pd.blogid, null, new { @class = "help-inline" })
                                            </div>
                                        </div>
                </div>
            <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-3 col-md-3 col-lg-4">
                <div class="form-group">
                    @Html.LabelFor(model => model.pd.license, new { @class = "control-label" })
                            <div class="controls">
                                @Html.DropDownListFor(model => model.pd.license, (List<SelectListItem>)ViewBag.License, "", new { @class = "form-control input-sm" })
                                        @Html.ValidationMessageFor(model => model.pd.license, null, new { @class = "help-inline" })
                                            </div>
                                        </div>
                                    </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.pd.title, new { @class = "control-label" })
                <div class="controls">
                    @Html.TextBoxFor(model => model.pd.title, new { @class = "form-control input-sm" })
                        @Html.ValidationMessageFor(model => model.pd.title, null, new { @class = "help-inline" })
                        </div>
                    </div>

        <div class="form-group">
            @Html.LabelFor(model => model.pd.description, new { @class = "control-label" })
                <div class="controls">
                    @Html.TextAreaFor(model => model.pd.description, new { @class = "ckeditor form-control", rows = "20" })
                        @Html.ValidationMessageFor(model => model.pd.description, null, new { @class = "help-inline" })
                        </div>
                    </div>
        <div class="row">
        <div class="col-sm-3 col-md-3 col-lg-3">
        <div class="form-group">
            @Html.LabelFor(model => model.pd.wp_page_parent_id, new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(model => model.pd.wp_page_parent_id, new { @class = "form-control input-sm" })
                @Html.ValidationMessageFor(model => model.pd.wp_page_parent_id, null, new { @class = "help-inline" })
            </div>
        </div>
        </div>
            <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-2 col-md-2 col-lg-2">
                <div class="form-group">
                    @Html.LabelFor(model => model.pd.wp_page_order, new { @class = "control-label" })
                            <div class="controls">
                                @Html.TextBoxFor(model => model.pd.wp_page_order, new { @class = "form-control input-sm" })
                                        @Html.ValidationMessageFor(model => model.pd.wp_page_order, null, new { @class = "help-inline" })
                                            </div>
                                        </div>
                                    </div>
            <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-1 col-md-1 col-lg-1">
                <div class="form-group">
                    @Html.LabelFor(model => model.pd.IsPublished, new { @class = "control-label" })
                            <div class="controls">
                                @Html.EditorFor(model => model.pd.IsPublished)
                                        @Html.ValidationMessageFor(model => model.pd.IsPublished, null, new { @class = "help-inline" })
                                            </div>
                                        </div>
                                    </div>
            <div class="col-sm-offset-1 col-md-offset-1 col-lg-offset-1 col-sm-3 col-md-3 col-lg-3">
                <div class="form-group">
                    @Html.LabelFor(model => model.pd.DateCreated, new { @class = "control-label" })
                            <div class="controls">
                                @if ((bool)ViewBag.LegacyBrowser) {
                                    @Html.TextBoxFor(model => model.dateCreatedString, new { @class = "form-control input-sm" })
                                } else {
                                @Html.EditorFor(model => model.pd.DateCreated)
                                        @Html.ValidationMessageFor(model => model.pd.DateCreated, null, new { @class = "help-inline" })
                                }
                                            </div>
                                        </div>
                                    </div>
        </div>
        <div class="form-actions">
            <input type="submit" value="Create" class="btn btn-default btn-primary" />
        </div>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jqueryui")
}

